#include "weathersearch.h"
#include "ui_weathersearch.h"

weatherSearch::weatherSearch(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::weatherSearch)
{
    ui->setupUi(this);
    p =new weather(ui->widget);
    p->hide();

}

weatherSearch::~weatherSearch()
{
    delete ui;
}

void weatherSearch::on_pushButton_clicked()
{
    QString seachText = ui->lineEdit->text();
    p->manager->get(QNetworkRequest(QUrl(QString("http://t.weather.sojson.com/api/weather/city/%1").arg(seachText))));
    p->vhalfmonthData.clear();//清空数组中上一天气的内容
    p->show();
}

